<?php

namespace WoXuanWang\Advertisement\Requests;

use Illuminate\Foundation\Http\FormRequest;
use WoXuanWang\Advertisement\Models\Advertisement;

class CreateAdvertisementRequest extends FormRequest
{

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $rules              = Advertisement::$rules;
        $rules['start_at']  = 'required';
        $rules['end_at']    = 'required';
        return $rules;
    }

    public function attributes()
    {
        return [
            'url'      => '点击链接',
            'start_at' => '生效日期',
            'end_at'   => '截止日期'
        ];
    }
}
